/**********************************************************************
* Filename: Golo.java
* Created: 2012/04/30
* @author Fernando Brito e Abreu
**********************************************************************/
package org.bunny.businessLayer;

import java.util.Set;
import java.util.HashSet;

public class Golo{
	public static Set<Golo> allInstances = new HashSet<Golo>();
	
	private int minuto;
	private Membro marcador;
	
	/**********************************************************************
	* Default constructor
	**********************************************************************/
	public Golo(){
		allInstances.add(this);
	}
	
	/**********************************************************************
	* Parameterized constructor
	* @param minuto the minuto to initialize
	* @param marcador the marcador to initialize
	**********************************************************************/
	public Golo(int minuto, Membro marcador){
		this.minuto = minuto;
		this.marcador = marcador;
		allInstances.add(this);
	}
	
	/**********************************************************************
	* Standard attribute getter
	* @return the minuto of the golo
	**********************************************************************/
	public int minuto(){
		return minuto;
	}
	
	/**********************************************************************
	* Standard attribute setter
	* @param minuto the minuto to set
	**********************************************************************/
	public void setMinuto(int minuto){
		this.minuto = minuto;
	}
	
	/**********************************************************************
	* ONE2MANY getter for Golo[*] <-> Membro[1]
	* @return the marcador of the golo
	**********************************************************************/
	public Membro marcador(){
		return marcador;
	}
	
	/**********************************************************************
	* ONE2MANY setter for Golo[*] <-> Membro[1]
	* @param marcador the marcador to set
	**********************************************************************/
	public void setMarcador(Membro marcador){
		this.marcador = marcador;
	}
	
//	/**********************************************************************
//	* User-defined operation specified in SOIL/OCL
//	* @param minuto the minuto to set
//	**********************************************************************/
//	public void inicializa(int minuto){
//		this.minuto = minuto;
//		//	self.minuto := minuto;
//	}
	
	//	PRE-CONDITIONS (TODO)
	/*
	pre MinutoEstaDefinido
		minuto.isDefined
	
	*/
	
	//	POST-CONDITIONS (TODO)
	/*
	post MinutoFoiInicializado
		self.minuto.isDefined
	
	*/
	
	/* (non-Javadoc)
	* @see java.lang.Object#toString()
	*/
	@Override
	/**********************************************************************
	* Object serializer
	**********************************************************************/
	public String toString(){
		return "Golo [minuto=" + minuto + ", marcador=" + marcador + "]\n";
	}
	
	//	-------------------------------------------------------------------------------
	//	INVARIANTS (TODO)
	/*
	inv GoloMarcadoDuranteOPeriodoDeJogo
		((self.minuto > 0) and (self.minuto < 130))
	
	*/
}
